package scan.thread;

import scan.mapper.ShopMapper;
import scan.po.OrderPO;

import java.util.List;
import java.util.concurrent.CountDownLatch;

public class MyThread extends Thread{
    private ShopMapper shopMapper;
    private List<OrderPO> orderPOList;
    private CountDownLatch endLatch;
    public MyThread(ShopMapper shopMapper,List<OrderPO> orderPOList,CountDownLatch endLatch)
    {
        this.shopMapper=shopMapper;
        this.orderPOList=orderPOList;
        this.endLatch=endLatch;
    }

    @Override
    public void run(){
        shopMapper.insert(orderPOList);
        endLatch.countDown();
    }
}
